Skip to content

fix: update Java README transaction examples to transactions() API - #719

Merged
curfew-marathon merged 2 commits into
mainfrom
fix/java-readme-transactions-api
Aug 2, 2026
Merged

fix: update Java README transaction examples to transactions() API#719
curfew-marathon merged 2 commits into
mainfrom
fix/java-readme-transactions-api

Conversation

@curfew-marathon

@curfew-marathon curfew-marathon commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Updates the Java README template so the write examples teach the affirmative transaction API (transactions(boolean)) instead of the double-negative disableTransactions(boolean). The new API was added in openfga/java-sdk#352; both APIs coexist today and disableTransactions is not deprecated yet.

The template is the source of truth: the java-sdk README.md is generated, so its transaction examples cannot be fixed in java-sdk directly.

Changes

config/clients/java/template/README_calling_api.mustache, three lines:

  • .disableTransactions(false) becomes .transactions(true) in the transactional write example
  • .disableTransactions(true) becomes .transactions(false) in the non-transaction mode example, with .transactionChunkSize(5) kept alongside it
  • The non-transaction mode note now reads .transactions(false) instead of .disableTransactions(true)

Verification

Regenerated the Java SDK locally with make build-client-java. The generated README shows .transactions(true) / .transactions(false) at the write examples and no disableTransactions. Behavior is unchanged: transactions(false) is exactly equivalent to the prior disableTransactions(true).

Downstream effect

Merging to main triggers sync-sdks.yaml, which regenerates each SDK and opens a sync PR in the SDK repo. The resulting java-sdk PR will carry this README change. It will also carry pre-existing drift in the Retries section (position and wording), which comes from README_retries.mustache and predates this change, not from this PR. Reviewers of the java-sdk sync PR should expect those extra lines.

Why now

This is step 1 of retiring disableTransactions. Review on openfga/java-sdk#352 flagged that public guidance still teaches the double-negative method. The old methods cannot be deprecated until the docs and examples stop teaching them, and the deprecation stays blocked until this change ships in a release.

Out of scope

  • docs/GENERATING-A-NEW-SDK.md, which prescribes disableTransactions as a cross-SDK property. The Go, JS, Python, and .NET SDKs use different transaction option shapes, so aligning the shared spec is a separate cross-SDK design question.
  • Deprecating the methods and the java-sdk Javadoc and example changes, tracked separately.

Refs #718

Summary by CodeRabbit

  • Documentation
    • Updated Java SDK examples to use the transactions option for write operations.
    • Clarified how to enable and disable transaction mode in API calls.

Replace disableTransactions(bool) with the affirmative transactions(bool)
in the write examples and non-transaction mode note. Regenerating the Java
SDK propagates this to java-sdk README write examples.

Refs #718
@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7ed38ebb-9c78-4daf-8931-afcb67406e96

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

The Java SDK README replaces disableTransactions with transactions(true) and transactions(false) in write-operation documentation and examples.

Changes

Java transaction documentation

Layer / File(s) Summary
Update Java write examples
config/clients/java/template/README_calling_api.mustache
Transaction-enabled and transaction-disabled write examples now use the transactions option.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Possibly related issues

  • openfga/sdk-generator#718 — Directly tracks the Java README transaction API updates.
  • openfga/spring-boot-starter#186 — Covers the same migration from disableTransactions to transactions(false) in Java examples.
  • openfga/java-sdk#368 — Covers the migration of Java documentation from disableTransactions to transactions(...).
  • openfga/java-sdk#371 — Covers the Java README migration from disableTransactions to transactions.

Suggested reviewers: aaguiarz

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the update from the disableTransactions API to the transactions() API in Java README examples.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/java-readme-transactions-api

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Not ready to approve

The non-transaction example includes a now-misleading transactionChunkSize inline comment that incorrectly references transactions and should be updated for correctness.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Pull request overview

Updates the Java README mustache template in this SDK generator so generated Java SDK documentation uses the affirmative write transaction option API (transactions(boolean)) instead of the double-negative disableTransactions(boolean).

Changes:

  • Swapped .disableTransactions(false) to .transactions(true) in the transactional write example.
  • Swapped .disableTransactions(true) to .transactions(false) in the non-transaction mode example and updated the explanatory note accordingly.
File summaries
File Description
config/clients/java/template/README_calling_api.mustache Updates generated Java README write examples to use the transactions(...) API.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

Comment thread config/clients/java/template/README_calling_api.mustache Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@config/clients/java/template/README_calling_api.mustache`:
- Line 291: Update the SDK generation contract in docs/GENERATING-A-NEW-SDK.md
and related client contract documentation to use the same transactions API as
the Java template’s .transactions(...) call. Replace references to
ClientWriteOptions.disableTransactions(...) unless this README intentionally
targets a newer API, and keep all generation guidance consistent with the
version being generated.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b79963f9-bf91-4fba-8c7a-47717cd13277

📥 Commits

Reviewing files that changed from the base of the PR and between 3bcfe05 and 38e99cd.

📒 Files selected for processing (1)
  • config/clients/java/template/README_calling_api.mustache

Comment thread config/clients/java/template/README_calling_api.mustache
Address review feedback on the write examples. Correct the prose that
said writes are sent sequentially; the SDK splits them into chunks sent
in parallel, each chunk its own transaction. Reword the transactionChunkSize
inline comment so it no longer reads as contradictory in non-transaction mode.

Docs only, no behavior change.

Refs #718

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Ready to approve

The change is limited to Java README template wording/API usage updates and is internally consistent with no remaining references to disableTransactions in the repo.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

@curfew-marathon
curfew-marathon added this pull request to the merge queue Aug 2, 2026
Merged via the queue into main with commit 12f7ecd Aug 2, 2026
16 checks passed
@curfew-marathon
curfew-marathon deleted the fix/java-readme-transactions-api branch August 2, 2026 03:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants